
<head>
<meta charset="UTF-8">
</head>
<!-- BEGIN PAGE CONTAINER-->
    <div class="container-fluid" >
        <!-- BEGIN PAGE HEADER-->   
        <div class="row-fluid">
            <div class="span12">
               
                <!-- BEGIN PAGE TITLE & BREADCRUMB-->
                <h3 class="page-title">
                    财富 - GPS
                    <small id="displayTitle"></small>
                </h3>
                <ul class="breadcrumb">
                    <li>
                        <a href="#"><i class="icon-home"></i></a><span class="divider"></span>
                    </li>
                    <li>
                        <a href="#">财富 - 目标设定</a> <span class="divider">&nbsp;</span>
                    </li>

                </ul>
                <!-- END PAGE TITLE & BREADCRUMB-->
            </div>
        </div>
        <!-- END PAGE HEADER-->
        
        <!-- Begingoal discription -->
        <div class="row-fluid metro-overview-cont">

                <div data-desktop="span12" data-tablet="span12" class="span12 responsive">
                    <div class="metro-overview green-color clearfix">
                        <div class="display">
                            <i class="icon-fighter-jet"></i>
                        </div>
                        <div class="details">
                            <div class="numbers">当前正在进行目标为 - ${goal.goaltype}</div>
                            <div class="title">为达到该目标，您计划自${goal.asofdate} 后${goal.timeframe}年拥有${goal.expectedamount}元。<br>
                                您拥有起始资金${goal.startamount}元,每年计划追加资金${goal.incrementalamount}元。<br>
                                当前目标详细达成情况请关注<strong><a class="" href="userDashboard">财富导航</a></strong>
                                    
                            </div>
                           

                        </div>
                    </div>
                </div>

            </div>
                            
                            <!-- End goal discription -->
        <!-- BEGIN PAGE CONTENT-->
        <div cneass="row-fluid">
            <div class="span6">
                <!-- BEGIN SAMPLE FORMPORTLET-->
                <div class="widget">
                    <div class="widget-title">
                        <h4><i class="icon-reorder"></i>设定新财富目标</h4>
                        <span class="tools">
                            <a href="javascript:;" class="icon-chevron-down"></a>
                            <a href="javascript:;" class="icon-remove"></a>
                        </span>
                    </div>
                    <div class="widget-body">
                        <!-- BEGIN FORM-->
                        <form  class="form-horizontal" >

                            <div class="control-group">
                                <label class="control-label">为了</label>
                                <div class="controls">
                                    <select class="span12 " id="goaltype" tabindex="1" >
                                        <option value="退休无忧">退休无忧</option>
                                        <option value="安家置业">安家置业</option>
                                        <option value="结婚大事">结婚大事</option>
                                        <option value="子女教育">子女教育</option>      
                                        <option value="短期目标" tiptext="购物旅游求学计划等等">短期目标</option>    
                                    </select>
                                </div>
                            </div>

                            我预计<br>
                            <input class="sy-textline input_tip" id="timeframe" tiptext="您预计几年后用到这笔的钱 （时间限定在0～50年之间，包括第1年和第50年）" type="text">
                            <br>年后用到这笔钱。
                            <br>
                            预计到时需要<br>
                            <input class="sy-textline input_tip" id="expectedamount" tiptext="请估算您大概需要的总金额" type="text">元,
                            <br>
                             现在可以拿出<br>
                            <input class="sy-textline input_tip" id="startamount" tiptext="请估算您现在可以拿出" type="text">元,
                            <br>
                            预计每年可以追加投资<br>
                            <input class="sy-textline input_tip" id="incrementalamount" tiptext="请估算您每年可以追加投资的总金额" type="text">元。</p>

                            </div>
                            <div class="form-actions">
                                <button id="submit" type="submit" class="btn blue"><i class="icon-ok"></i> 提交</button>

                            </div>
                        </form>
                        <!-- END FORM-->
                    </div>
                </div>
                <!-- END SAMPLE FORM PORTLET-->
            </div>
        </div>

        <!-- END PAGE CONTENT-->         
    
    <script>
    $(document).ready(function(){      
    	App.init(); 
    	var displayname=$("#displayname").val();
    	var id=$("#id").val();
        $("#displayTitle").append(displayname+"的财富目标设定");
        }); 
    
    $("#submit").click(function(){	
    	
    	var goaltype =$("#goaltype").val();
    	var id=$("#id").val();
    	var timeframe=$("#timeframe").val();
    	var expectedamount=$("#expectedamount").val();
    	var startamount=$("#startamount").val();
    	var incrementalamount=$("#incrementalamount").val();
    	
    	var data={"id":id, "goaltype":goaltype, "timeframe":timeframe, "expectedamount":expectedamount,"startamount":startamount, "incrementalamount":incrementalamount};
    	    	
    	$.ajax({
			type : "POST",
			contentType : "application/json",
			url : "/newGoal",
			data : JSON.stringify(data),
			dataType : 'json',
			timeout : 10000,
success : function(data) {
 				
 				alert("财富目标设定成功");
 			},
 			error : function(e) {
 				
 				alert("error");
 			},
 			done : function(e) {
 				alert("done");
 			}
		});
    	
    	$("#pageContainer").remove();	
    	$("#main-content").load("pages/newPortfolioBody.html");	
    });
   

  
</script>


    <!-- END PAGE CONTAINER-->